
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class REPAIR_ORDERSMap : EntityTypeConfiguration<REPAIR_ORDERS>
    {
        public REPAIR_ORDERSMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.REPAIR_ORDER_NO)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.OBU_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.USER_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.REPORTER)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.TEL_NO)
                .HasMaxLength(50);

            this.Property(t => t.MOBILE_TEL_NO)
                .HasMaxLength(50);

            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.CLIENT_IP)
                .HasMaxLength(200);

            this.Property(t => t.REPAIRED_COMMENT)
                .HasMaxLength(50);

            this.Property(t => t.SPARE_OBU_NO)
                .IsFixedLength()
                .HasMaxLength(16);

            this.Property(t => t.CURRENT_HANDLER)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.RETURNED_COMMENT)
                .HasMaxLength(200);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.MODIFY_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("REPAIR_ORDERS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.REPAIR_ORDER_NO).HasColumnName("REPAIR_ORDER_NO");
            this.Property(t => t.OBU_NO).HasColumnName("OBU_NO");
            this.Property(t => t.USER_NO).HasColumnName("USER_NO");
            this.Property(t => t.REGISTER_DATE).HasColumnName("REGISTER_DATE");
            this.Property(t => t.REPORTER).HasColumnName("REPORTER");
            this.Property(t => t.TEL_NO).HasColumnName("TEL_NO");
            this.Property(t => t.MOBILE_TEL_NO).HasColumnName("MOBILE_TEL_NO");
            this.Property(t => t.MAX_PRICE).HasColumnName("MAX_PRICE");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.CLIENT_IP).HasColumnName("CLIENT_IP");
            this.Property(t => t.FACE_STATUS).HasColumnName("FACE_STATUS");
            this.Property(t => t.REPAIR_TYPE).HasColumnName("REPAIR_TYPE");
            this.Property(t => t.REPAIRED_COMMENT).HasColumnName("REPAIRED_COMMENT");
            this.Property(t => t.IS_FREE).HasColumnName("IS_FREE");
            this.Property(t => t.SPARE_OBU_NO).HasColumnName("SPARE_OBU_NO");
            this.Property(t => t.SPARE_OBU_PRICE).HasColumnName("SPARE_OBU_PRICE");
            this.Property(t => t.SPARE_OBU_ISSUE_DATE).HasColumnName("SPARE_OBU_ISSUE_DATE");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.CURRENT_HANDLER).HasColumnName("CURRENT_HANDLER");
            this.Property(t => t.CONFIRM_REPAIRED).HasColumnName("CONFIRM_REPAIRED");
            this.Property(t => t.DISPOSE_TYPE).HasColumnName("DISPOSE_TYPE");
            this.Property(t => t.FINISHED_DATE).HasColumnName("FINISHED_DATE");
            this.Property(t => t.GET_BACK_DATE).HasColumnName("GET_BACK_DATE");
            this.Property(t => t.IS_RETURNED_SPARE_OBU).HasColumnName("IS_RETURNED_SPARE_OBU");
            this.Property(t => t.RETURNED_COMMENT).HasColumnName("RETURNED_COMMENT");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.MODIFY_BY).HasColumnName("MODIFY_BY");
            this.Property(t => t.MODIFY_DATE).HasColumnName("MODIFY_DATE");
            this.Property(t => t.SUPPLIER).HasColumnName("SUPPLIER");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.VEHICLE_PLATE_NO).HasColumnName("VEHICLE_PLATE_NO");
            this.Property(t => t.VEHICLE_CLASS).HasColumnName("VEHICLE_CLASS");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.SPEC_ID).HasColumnName("SPEC_ID");
            this.Property(t => t.ORDER_TYPE).HasColumnName("ORDER_TYPE");
            //this.Property(t => t.REPORT_DATE).HasColumnName("REPORT_DATE");
        }
    }
}
